﻿using System;
namespace padmsg._api
{
    using yunio;
    internal partial class padapi
    {
        /// <summary>
        /// 获取个人资料
        /// </summary>
        public static YunioJson get_me_profile(string uri, string token)
        {
            uri += "/user/GetProfile";

            return YunioHttp.GetJson(uri, YunioParam.New("key", token));
        }
        /// <summary>
        /// 获取自己的二维码
        /// </summary>
        public static YunioJson get_me_qrcode(string uri, string token, bool recover, int style)
        {
            uri += "/user/GetMyQRCode";

            var json = YunioJson.NewObj().SetBoolean("Recover", recover).SetNumber("Style", style);
            return YunioHttp.GetJson(uri, YunioParam.New("key", token));
        }
        /// <summary>
        /// 获取设备记录
        /// </summary>
        public static YunioJson get_me_safetyinfo(string uri, string token)
        {
            uri += "/equipment/GetSafetyInfo";

            return YunioHttp.PostJson(uri, YunioParam.New("key", token));
        }
        /// <summary>
        /// 修改头像
        /// </summary>
        public static YunioJson upload_headimage(string uri, string token, string head_img_base64)
        {
            uri += "/user/UploadHeadImage";

            var json = YunioJson.NewObj().SetText("Base64", head_img_base64);
            return YunioHttp.PostJson(uri, YunioParam.New("key", token), json);
        }
    }
}
